<template>
  <el-row class="tac">
    <el-col>
      <el-menu
        active-text-color="#ffd04b"
        background-color="#545c64"
        class="el-menu-vertical-demo"
        default-active="2"
        text-color="#fff"
        @open="handleOpen"
        @close="handleClose"
      >
        <!-- {{scriptMenu[0]}} -->
        <!-- {{ script }} -->
        <el-sub-menu index="1">
          <template #title>
            <el-icon><location /></el-icon>
            <span>剧本列表</span>
          </template>

          <el-menu-item index="1-1" v-for="(item, index) in scriptMenu" :key="index">
            {{ item.scriptName }}
          </el-menu-item>
          <el-menu-item index="1-2">item one</el-menu-item>
        </el-sub-menu>
      </el-menu>
    </el-col>
  </el-row>
</template>

<script lang="ts" setup>
import { Location, Document, Menu as IconMenu, Setting } from "@element-plus/icons-vue";
import { computed, ref, toRefs } from "vue";
import { useStore } from "vuex";
import { IGetListResult, IGetListResultBase } from "@/service/list/types";
const store = useStore();
const num = ref(100);
// const scriptMenu = (computed(() => store.state["moduleScriptList"].scriptList));
// const scriptMenu = toRefs(computed(() => store.state["moduleScriptList"].scriptList));
const scriptMenu: IGetListResultBase[] = computed<IGetListResultBase[]>(
  () => store.state["moduleScriptList"].scriptList as IGetListResultBase[]
).value;

const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath);
};
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath);
};
</script>

<style lang="less">
.tac {
  height: 100%;
}
.el-menu {
  //   min-height: 95vh;
  height: 100%;
}
</style>
